<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class mysql</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class mysql</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">mysql查询类</p>
		<p class="notes">
			Located in <a class="field" href="_class---mysql.class.php.html">/class/mysql.class.php</a> (line <span class="field">6</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																												<div class="var-title">
					static <span class="var-type">int</span>
					<a href="#$querynum" title="details" class="var-name">$querynum</a>
				</div>
																												<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$error" title="details" class="var-name">$error</a>
				</div>
																<div class="var-title">
					<span class="var-type">object</span>
					<a href="#$link" title="details" class="var-name">$link</a>
				</div>
																								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$sqls" title="details" class="var-name">$sqls</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																																																																						
				<div class="method-definition">
											<span class="method-result">mysql</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$dbhost</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$dbuser</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$dbpw</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$dbname</span> = <span class="var-default">''</span>], <span class="var-type"></span>&nbsp;<span class="var-name">$dbcharset</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$pconnect</span> = <span class="var-default">0</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#affected_rows" title="details" class="method-name">affected_rows</a>
										()
									</div>
														
				<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#close" title="details" class="method-name">close</a>
										()
									</div>
														
				<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#errno" title="details" class="method-name">errno</a>
										()
									</div>
														
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#error" title="details" class="method-name">error</a>
										()
									</div>
														
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#fetch_array" title="details" class="method-name">fetch_array</a>
											(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$result_type</span> = <span class="var-default">MYSQL_ASSOC</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">object</span>
										<a href="#fetch_fields" title="details" class="method-name">fetch_fields</a>
											(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>)
									</div>
														
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#fetch_row" title="details" class="method-name">fetch_row</a>
											(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>)
									</div>
														
				<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#free_result" title="details" class="method-name">free_result</a>
											(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>)
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#halt" title="details" class="method-name">halt</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$message</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span> = <span class="var-default">''</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#insert_id" title="details" class="method-name">insert_id</a>
										()
									</div>
														
				<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#num_fields" title="details" class="method-name">num_fields</a>
											(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>)
									</div>
														
				<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#num_rows" title="details" class="method-name">num_rows</a>
											(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>)
									</div>
														
				<div class="method-definition">
											<span class="method-result">object</span>
										<a href="#query" title="details" class="method-name">query</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">''</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">mixed</span>
										<a href="#result" title="details" class="method-name">result</a>
											(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$row</span> = <span class="var-default">'gbk'</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#select_db" title="details" class="method-name">select_db</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$dbname</span>)
									</div>
														
				<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#version" title="details" class="method-name">version</a>
										()
									</div>
											</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$querynum" id="$querynum"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			static <span class="var-type">int</span>
			<span class="var-name">$querynum</span>
			 = <span class="var-default"> 0</span>			(line <span class="line-number">12</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">查询总次数</p>
	
	
		
		

</div>

<a name="var$error" id="$error"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$error</span>
			 = <span class="var-default"> false </span>			(line <span class="line-number">20</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
<a name="var$link" id="$link"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">object</span>
			<span class="var-name">$link</span>
						(line <span class="line-number">18</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">连接句柄</p>
	
	
		
		

</div>
<a name="var$sqls" id="$sqls"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$sqls</span>
			 = <span class="var-default">''</span>			(line <span class="line-number">19</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">31</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">构造函数</p>
	
	<div class="method-signature">
		<span class="method-result">mysql</span>
		<span class="method-name">
			__construct
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$dbhost</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$dbuser</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$dbpw</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$dbname</span> = <span class="var-default">''</span>], <span class="var-type"></span>&nbsp;<span class="var-name">$dbcharset</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$pconnect</span> = <span class="var-default">0</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$dbhost</span><span class="var-description">: 主机名</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$dbuser</span><span class="var-description">: 用户</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$dbpw</span><span class="var-description">: 密码</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$dbname</span><span class="var-description">: 数据库名</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$pconnect</span><span class="var-description">: 是否持续连接</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$dbcharset</span>			</li>
				</ul>
		
			
	</div>
<a name="methodaffected_rows" id="affected_rows"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">affected_rows</span> (line <span class="line-number">101</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">取影响条数</p>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			affected_rows
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodclose" id="close"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">close</span> (line <span class="line-number">199</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">关闭连接</p>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			close
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methoderrno" id="errno"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">errno</span> (line <span class="line-number">117</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">返回错误代码</p>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			errno
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methoderror" id="error"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">error</span> (line <span class="line-number">109</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">返回错误信息</p>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			error
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodfetch_array" id="fetch_array"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">fetch_array</span> (line <span class="line-number">74</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">取出结果集中一条记录</p>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			fetch_array
		</span>
					(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$result_type</span> = <span class="var-default">MYSQL_ASSOC</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">object</span>
				<span class="var-name">$query</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$result_type</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfetch_fields" id="fetch_fields"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">fetch_fields</span> (line <span class="line-number">183</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">从结果集中取得列信息并作为对象返回</p>
	
	<div class="method-signature">
		<span class="method-result">object</span>
		<span class="method-name">
			fetch_fields
		</span>
					(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">object</span>
				<span class="var-name">$query</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfetch_row" id="fetch_row"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">fetch_row</span> (line <span class="line-number">173</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">从结果集中取得一行作为枚举数组</p>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			fetch_row
		</span>
					(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">object</span>
				<span class="var-name">$query</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfree_result" id="free_result"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">free_result</span> (line <span class="line-number">156</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">释放结果集</p>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			free_result
		</span>
					(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">object</span>
				<span class="var-name">$query</span>			</li>
				</ul>
		
			
	</div>
<a name="methodhalt" id="halt"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">halt</span> (line <span class="line-number">208</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">输出错误信息</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			halt
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$message</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span> = <span class="var-default">''</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$message</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$sql</span>			</li>
				</ul>
		
			
	</div>
<a name="methodinsert_id" id="insert_id"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">insert_id</span> (line <span class="line-number">164</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">返回自增ID</p>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			insert_id
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodnum_fields" id="num_fields"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">num_fields</span> (line <span class="line-number">147</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">取字段总数</p>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			num_fields
		</span>
					(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">object</span>
				<span class="var-name">$query</span>			</li>
				</ul>
		
			
	</div>
<a name="methodnum_rows" id="num_rows"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">num_rows</span> (line <span class="line-number">137</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">结果条数</p>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			num_rows
		</span>
					(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">object</span>
				<span class="var-name">$query</span>			</li>
				</ul>
		
			
	</div>
<a name="methodquery" id="query"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">query</span> (line <span class="line-number">85</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">查询SQL</p>
	
	<div class="method-signature">
		<span class="method-result">object</span>
		<span class="method-name">
			query
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">''</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$sql</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$type</span>			</li>
				</ul>
		
			
	</div>
<a name="methodresult" id="result"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">result</span> (line <span class="line-number">127</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">返回查询结果</p>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			result
		</span>
					(<span class="var-type">object</span>&nbsp;<span class="var-name">$query</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$row</span> = <span class="var-default">'gbk'</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">object</span>
				<span class="var-name">$query</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$row</span>			</li>
				</ul>
		
			
	</div>
<a name="methodselect_db" id="select_db"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">select_db</span> (line <span class="line-number">64</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">选择数据库</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			select_db
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$dbname</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$dbname</span>			</li>
				</ul>
		
			
	</div>
<a name="methodversion" id="version"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">version</span> (line <span class="line-number">191</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">返回mysql版本</p>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			version
		</span>
				()
			</div>
	
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Mon, 11 Apr 2011 09:23:48 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>